<script setup lang="ts">
import Echarts from '../components/Echarts.vue';
import HeaderInput from '../components/HeaderInput.vue';
import { reactive, nextTick, provide, onMounted } from 'vue';
import { useStore } from '../store/data';
import { useRoute } from 'vue-router';

const store = useStore()
onMounted(() => {
  let route = useRoute()
  console.log(route, route.path)
  store.routePath = route.path
})

const state = reactive({
  showRouter: true
})
function reload() {
  console.log(false)
  state.showRouter = false
  nextTick(() => {
  console.log(true)
    state.showRouter = true
  })
}
provide('reload',reload)

</script>

<template>
    <HeaderInput></HeaderInput>
    <Echarts v-if="state.showRouter"></Echarts>
</template>

<style scoped></style>